home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 11 / PCPP11.iso / utils / frogbit / fb-097.exe / MAKE CSV HIGH.FB < prev    next >
Encoding:
Text File  |  1997-02-04  |  639 b   |  27 lines

  1.  
  2. // Extract comma-delimited data from a report
  3. // - high results only
  4.  
  5. set limit equal to (arg 1)
  6.  
  7. input "tests.prn"
  8.  
  9. do while (someLeft input)
  10.   skip lines until (line matches "~Results for ~(month) ~(year)")
  11.   skip lines until (line contains "-----")
  12.   do while (someLeft input)
  13.     read
  14.     leave if (line contains "-----")
  15.     error if (not (line matches "| ~(ages) | ~(test) | ~(result) |")) "unrecognised line"
  16.     if (result>limit)
  17.       write (year "," month "," ages "," test "," result)
  18.     endif
  19.   loop
  20.  
  21.   // comment out the next line to make the program run faster
  22.   refresh
  23.  
  24. loop
  25.  
  26. output "tests.csv"
  27.